<?php
class Will extends AppModel {
	var $name = 'Will';
	var $displayField = 'i_will';
	var $validate = array(
		'i_will' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'WE WILL cannot be left empty.',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'how' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'HOW cannot be left empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'when_date' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'WHEN Date cannot be left empty',
				//'allowEmpty' => false,
				//'required' => false,
				'last' => true, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'date' => array(
				'rule' => array('date','ymd'),
				'message' => 'Invalid Date format(yyyy-mm-dd)',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		)
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Program' => array(
			'className' => 'Program',
			'foreignKey' => 'program_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'WillMessage' => array(
			'className' => 'WillMessage',
			'foreignKey' => 'will_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'WillSchedule' => array(
			'className' => 'WillSchedule',
			'foreignKey' => 'will_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
